import { initMixin } from './init'
import { stateMixin } from './state'
import { renderMixin } from './render'
import { eventsMixin } from './events'
import { lifecycleMixin } from './lifecycle'
import { warn } from '../util/index'
//todo 1.申明构造函数
function Vue (options) {
  if (process.env.NODE_ENV !== 'production' &&
    !(this instanceof Vue)
  ) {
    warn('Vue is a constructor and should be called with the `new` keyword')
  }
  this._init(options)
}
// todo 2.实例属性，实例方法：
initMixin(Vue) //todo 实现_init方法
stateMixin(Vue) //todo $data/$parent/$set()/$delete()/$watch()
eventsMixin(Vue) //todo $emit()/$on/$off/$once()
lifecycleMixin(Vue) //todo _update()/$forceUpdate()/$destroy()
renderMixin(Vue) //todo $nextTick()/_render()

export default Vue
